package com.dnzx.controller.web;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.dnzx.framework.result.ResultUtils;
import org.dnzx.framework.result.domain.Result;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dnzx.model.SubCategoryBO;
import com.dnzx.service.ISubCategoryService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping("/web/subCategory")
@Api(value = "/web/subCategory",description="副柜",produces=MediaType.APPLICATION_JSON_VALUE)
public class WebSubCategoryController {
	
	@Resource
	private ISubCategoryService subCategoryService;
	
	/**
	 * 查询 - 不分页
	 * @param subCategoryBO
	 * @return
	 */
	@PostMapping("/queryList")
	@ApiOperation(value="/queryList",notes="查询 -不 分页：参数：categoryId",httpMethod="POST",produces=MediaType.APPLICATION_JSON_VALUE)
	public Result queryList(@ApiParam(value = "实体") @RequestBody SubCategoryBO subCategoryBO, HttpServletRequest request) {
		try {
			List<SubCategoryBO> subCategoryBOList = this.subCategoryService.queryList(subCategoryBO);
			return ResultUtils.returnSuccess("SUCCESS", subCategoryBOList);
		} catch(Exception e) {
			e.printStackTrace();
			return ResultUtils.returnError(e.getMessage());
		}
	}
	
}
